//
//  iToast.h
//  iToastDemo
//  
//  Created by amao on 12/12/11.
//  Copyright (c) 2011 Netease. All rights reserved.
//

#import <Foundation/Foundation.h>
@protocol ToastProtocol <NSObject>
-(void)toastTimeOver:(int)toastTag;
@end

typedef enum
{
    kToastPositionTop,
    kToastPositionCenter,
    kToastPositionBottom,
} ToastPosition;

typedef enum 
{
    kToastDurationShort = 2,
    kToastDurationNormal= 3,
    kToastDurationLong  =10,
    kToastDuration1Second  =1,
    kToastDuration2Second  =2,
    kToastDuration3Second  =3,
    kToastDuration5Second  =5,
    kToastDuration10Second  =10,
     kToastDuration15Second  =15,
     kToastDuration20Second  =20,
    kToastDuration60Second  =60,
    kToastDurationForever=100000000000
} ToastDuration;

@interface iToast : NSObject
{
    ToastPosition   toastPosition;
    ToastDuration   toastDuration;
    NSString        *toastText;
    UIView          *view;
    BOOL countDown;
    int tag;
    
}
@property (nonatomic,assign) id<ToastProtocol> toastDelegate;
@property (assign,nonatomic)    ToastPosition toastPosition;
@property (assign,nonatomic)    ToastDuration toastDuration;
@property (retain,nonatomic)    NSString      *toastText;
//是否采用倒计时
@property (nonatomic)    BOOL countDown;
@property (nonatomic)    int  tag;
- (id)initWithText: (NSString *)text;
- (void)show;

+ (iToast *)makeToast: (NSString *)text;


- (void)hideToast: (id)sender;
- (void)onHideToast: (NSTimer *)timer;
- (void)onRemoveToast: (NSTimer *)timer;
- (void)doHideToast;

@end
